$(function(){
	/* 注册表单验证 */
	$('#defaultForm')
		.bootstrapValidator({
		    feedbackIcons: {
		        valid: 'glyphicon glyphicon-ok',
		        invalid: 'glyphicon glyphicon-remove',
		        validating: 'glyphicon glyphicon-refresh'
		    },
		    fields: {
		        username: {
		            validators: {
		                notEmpty: {
							message: '账号不能为空'
		                },
		                stringLength: {
		                    min: 8,
		                    max: 20,
		                    message: '用户名请设置8-20个字符'
		                },
		                /*remote: {
		                    url: 'remote.php',
		                    message: 'The username is not available'
		                },*/
		                regexp: {
		                    regexp: /^[a-zA-Z0-9_\.]+$/,
		                    message: '用户名必须满足大小写字母数字及符号'
		                }
		            }
		        },
		        mobile: {
		            validators: {
		                notEmpty: {
		                    message: '手机号不能为空'
		                },
						regexp: {
						    regexp: /^1(3|4|5|7|8)\d{9}$/,
						    message: '手机号格式不正确'
						}
		            }
		        },
				'choice[]': {
				    validators: {
				        choice: {
				            min: 1,
				            max: 1,
				            message: '选择协议才可以注册'
				        }
				    }
				},
		        password: {
		            validators: {
		                notEmpty: {
		                    message: '密码不能为空'
		                }
		            }
		        },
				confirmpassword:{
					validators: {
					    notEmpty: {
					        message: '密码不能为空'
					    }
					}
				}
		    }
		});
		/* 注册表单验证结束 */
});			 